package dmir.reaction.publico.graph.elements;

public class Node {
	
	public String ename;
	public String etype;
	public int id;
	public int freq;
	public double score;
	
	public Node(){
		super();
	}
	
	public Node(Integer id, String ename, String etype, int freq) {
		super();
		this.ename = ename;
		this.etype = etype;
		this.id = id;
		this.freq = freq;
		this.score = 0;
	}
	
	public String toString() {
		//return etype+':'+ename+'('+Integer.toString(id)+')';		
		return etype+':'+ename;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ename == null) ? 0 : ename.hashCode());
		result = prime * result + ((etype == null) ? 0 : etype.hashCode());
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Node other = (Node) obj;
		if (ename == null) {
			if (other.ename != null)
				return false;
		} else if (!ename.equals(other.ename))
			return false;
		if (etype == null) {
			if (other.etype != null)
				return false;
		} else if (!etype.equals(other.etype))
			return false;
		if (id != other.id)
			return false;
		return true;
	}

	
}